﻿var _{{id}} = (function() {
    return {
        update: function(payload) {
            var data = JSON.parse(payload);
            $('#{{id}} .bignumber-value').text(data.value);
            $('#{{id}} .bignumber-date').text(moment(data.date).format('MMMM Do YYYY, h:mm:ss a'));

            if (data.imageUrl) {
                $('#{{id}} .bignumber-image').attr('src', data.imageUrl);
                $('#{{id}} .bignumber-image').show();
            } else {
                $('#{{id}} .bignumber-image').hide();
            }
        }
    };
}());
